<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul id="box">
    <!-- <li><span>名称</span>------------- <span>价格</span></li> -->
  </ul>
  <div>
    <button>全部</button>
    <button>1</button>
    <button>2</button>
  </div>
  <script src="./jquery-3.4.1.min.js"></script>
  <script>
    // $.get("请求地址", "发送的数据", function () { }, "预期返回的数据类型");
    // 预期返回的数据类型  json text html script jsonp xml 
    $("button").click(function () {
      var val = $(this).html();
      $.get("http://127.0.0.8:8888/users/prolist", { page: val }, function (res) {
        console.log(res)
        var str = ``
        $.each(res, function (index, ele) {
          str += `<li><span>${ele.pname}</span>------------- <span>${ele.price}</span></li>`
        })
        $("#box").html(str)
      })
    })







  </script>
</body>

</html>